package com.organize.application.dto.employee;

import com.autumn.application.dto.DefaultEntityDto;
import com.autumn.util.excel.annotation.ExcelColumn;
import com.autumn.validation.annotation.NotNullOrBlank;
import com.autumn.validation.annotation.Sex;
import com.organize.entities.Employee;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

/**
 * 职员输入
 * <p>
 * </p>
 *
 * @description TODO
 * @author: 老码农
 * @create: 2020-10-17 14:59
 **/
@Getter
@Setter
public class EmployeeInput extends DefaultEntityDto {

    private static final long serialVersionUID = 273054023502920727L;

    /**
     * 编号
     */
    @ApiModelProperty(value = "编号(必输)(maxLength =" + Employee.MAX_LENGTH_CODE + ")")
    @NotNullOrBlank(message = "编号不能为空。")
    @Length(max = Employee.MAX_LENGTH_CODE, message = "编号 不能超过 " + Employee.MAX_LENGTH_CODE + " 个字。")
    @ExcelColumn(order = 1, friendlyName = "编号", width = 80)
    private String code;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称(必输)(maxLength =" + Employee.MAX_LENGTH_NAME + ")")
    @NotNullOrBlank(message = "名称不能为空。")
    @Length(max = Employee.MAX_LENGTH_NAME, message = "名称 不能超过 " + Employee.MAX_LENGTH_NAME + " 个字。")
    @ExcelColumn(order = 2, friendlyName = "名称", width = 80)
    private String name;

    /**
     * 性别
     */
    @ApiModelProperty(value = "性别(必输)(maxLength =" + Employee.MAX_LENGTH_SEX + ")")
    @NotNullOrBlank(message = "性别不能为空。")
    @Length(max = Employee.MAX_LENGTH_SEX, message = "性别 不能超过 " + Employee.MAX_LENGTH_SEX + " 个字。")
    @ExcelColumn(order = 3, friendlyName = "性别", width = 80)
    @Sex
    private String sex;

    /**
     * 身份证号
     */
    @ApiModelProperty(value = "身份证号(maxLength =" + Employee.MAX_LENGTH_ID_CARD + ")")
    @Length(max = Employee.MAX_LENGTH_ID_CARD, message = "身份证号 不能超过 " + Employee.MAX_LENGTH_ID_CARD + " 个字。")
    @ExcelColumn(order = 4, friendlyName = "身份证号", width = 80)
    private String idCard;

    /**
     * 部门id
     */
    @ApiModelProperty(value = "部门id(必输)")
    @NotNull(message = "部门id不能为空。")
    private Long departmentId;

    /**
     * 岗位id
     */
    @ApiModelProperty(value = "岗位id(必输)")
    @NotNull(message = "岗位id不能为空。")
    private Long postId;

    /**
     * 学历id
     */
    @ApiModelProperty(value = "学历id(必输)")
    @NotNull(message = "学历id不能为空。")
    private Long educationId;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @ExcelColumn(order = 99, friendlyName = "备注", width = 80)
    private String remarks;

    @Override
    public void valid() {
        super.valid();
    }
}
